#include "../Job.h"
#include "../Counter.h"

namespace Anger
{
	void Job::Reset()
	{
		if (!IsNull())
		{
			GetDelegate()->~DelegateBase();
			*(void**)buffer = nullptr;
		}
	}

	void Job::Execute()
	{
		if (!IsNull()) {
			printf("job execute\n");
			GetDelegate()->Call();
		}
		if (counter) {
			counter->Decrement();
		}
	}
}
